package com.usian.admin.feign

import com.usian.model.article.pojos.ApArticle
import com.usian.model.article.pojos.ApArticleConfig
import com.usian.model.article.pojos.ApArticleContent
import com.usian.model.article.pojos.ApAuthor
import com.usian.model.common.dtos.ResponseResult
import org.springframework.cloud.openfeign.FeignClient
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping

@FeignClient("leadnews-article")
interface ArticleFeign1 {
//    @PostMapping("/api/v1/article_config/save")
//    fun saveArticleConfig(apArticleConfig: ApArticleConfig): ResponseResult<*>
//
//    @GetMapping("/api/v1/author/findByName/{name}")
//    fun selectAuthorByName(@PathVariable("name") name: String): ApAuthor
//
//    @PostMapping("/api/v1/article/save")
//    fun saveArticle(apArticle: ApArticle): ApArticle
//
//    @PostMapping("/api/v1/article_content/save")
//    fun saveArticleContent(apArticleContent: ApArticleContent): ResponseResult<*>
    /**
     * 保存文章配置信息
     */
    @PostMapping("/api/v1/article_config/save")
    fun saveArticleConfig(apArticleConfig: ApArticleConfig): ResponseResult<*>

    /**
     * 根据作者名称查询作者信息
     */
    @GetMapping("/api/v1/author/findByName/{name}")
    fun selectAuthorByName(@PathVariable("name") name: String): ApAuthor

    /**
     * 保存文章
     */
    @PostMapping("/api/v1/article/save")
    fun saveArticle(apArticle: ApArticle): ApArticle

    /**
     * 保存文章详情
     */
    @PostMapping("/api/v1/article_content/save")
    fun saveArticleContent(apArticleContent: ApArticleContent): ResponseResult<*>

}
